<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>打印采购单</title>
    <link rel="shortcut icon" href="/web/static/src/img/favicon.ico" type="image/x-icon">
    <link rel="stylesheet" href="/web/static/src/css/full.css">
    <link rel="stylesheet" href="/web/static/lib/fontawesome/css/font-awesome.css">
    <link rel="stylesheet" href="/web/static/lib/bootstrap/css/bootstrap.css">
    <link rel="stylesheet" href="/web/static/src/css/base.css">

    <script language="javascript" src="/lodop/static/src/js/mathlibrary.js"></script>

    <style type="text/css" id="style">
        body{padding: 10px; font-size: 10pt}
		.field_caption{
			font-size: 11pt;		  
			font-weight: bold;
			white-space:nowrap;
		@page {
		  size: A4;
		  margin: 0;
		}
        @media print
        {
			html, body {
				width: 210mm;
				height: 297mm;
		  	}
            .print-hide {display:none}

        .td_inline {
            display:block;
            overflow:hidden;
            white-space:nowrap;
            text-overflow:ellipsis;
            width: 370pt;
        }

        .nowrap{
            white-space:nowrap;
        }

        .curPre {

        }

        .table thead tr td{font-weight: bold; font-size: 11pt; }

        h4{margin: 0px;  padding: 0px;font-size: 14pt}

        h5{
            font-size:11pt; font-family:'黑体'; font-weight: bold; margin: 0px;  padding: 0px;
        }

        div{font-size: 10pt}

        span.foot_sign{border-bottom: 1px solid #ddd}

        .table tbody tr td{border-top: 1px solid #ddd;}
        .table tbody tr:last-child td{border-top: 1px solid #ddd;}
        .table tbody tr.memo td {padding:0px; border-top:0px }

        td{font-size:10pt}

        .font-middle{
            font-size: 12pt;
        }

        .page_head{
            padding-bottom: 20px;
        }

        .bottom-line{
            border-bottom:1px solid #DDD;
        }

        .oe_view_manager_body{position:relative}

    </style>
</head>

<body>
    <div class="openerp openerp_webclient_container">
        <table class="oe_webclient">
            <tbody>
            <tr>

                <td class="oe_application">
                    <div>
                        <div class="oe_view_manager oe_view_manager_current" data-view-type="form"
                             style="display: table;">


                            <div class="oe_view_manager_wrapper">
                                <div>
                                    <div class="oe_view_manager_body_1">


                                        <div class="oe_view_manager_view_form" style="display: block;">
                                            <div class="oe_formview oe_view oe_cannot_create oe_cannot_edit oe_cannot_delete oe_form_readonly"
                                                 style="opacity: 1;">
                                                <div class="oe_form_buttons"></div>
                                                <div class="oe_form_sidebar"></div>
                                                <div class="oe_form_pager"></div>
                                                <div class="oe_form_container">
                                                    <div class="oe_form">
                                                        <div class="oe_form_nosheet">

                                                            <table border="0" cellpadding="0" cellspacing="0"
                                                                   class="oe_form_group ">
                                                                <tbody>
                <tr>
                    <td colspan="4">
                        <h4 class="page_head" style="font-size: 12pt;font-weight: bold;">{{purchase_order.company_id.name}}采购单<span>{{purchase_order.name}}</span></h4>
                    </td>
                </tr>
                                                                <tr class="oe_form_group_row">
                                                                    <td class="oe_form_group_cell" colspan="1"
                                                                        width="50%">
                                                                        <table border="0" cellpadding="0"
                                                                               cellspacing="0" class="oe_form_group ">
                                                                            <tbody>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-79"
                                                                                        class=" oe_form_label_help oe_align_right"
                                                                                        data-original-title="" title="">
                                                                                    供应商
                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%"><span
                                                                                        class="oe_form_field oe_form_field_char oe_form_required">


            <span class="oe_form_char_content">
                            {{ purchase_order.partner_id.name|default('', True) }}</span>

    </span></td>
                                                                            </tr>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-80"
                                                                                        class=" oe_form_label oe_align_right">
                                                                                    供应商联系人
                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%"><span
                                                                                        class="oe_form_field oe_form_field_many2one oe_form_field_with_button oe_form_required">

            <span class="oe_form_char_content">{{purchase_order.contacts_id.contacts|default('', True) }}


                        {% if purchase_order.partner_id.phone %}
                            {{ purchase_order.partner_id.phone}}
                        {% elif purchase_order.partner_id.mobile %}
                            {{ purchase_order.partner_id.mobile}}
                        {% endif %}</span>


    </span></td>
                                                                            </tr>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-81"
                                                                                        class=" oe_form_label_help oe_align_right"
                                                                                        data-original-title="" title="">
                                                                                    电话/传真
                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%"><span
                                                                                        class="oe_form_char_content">{%if purchase_order.partner_id.fax%}
                            传真:{{purchase_order.partner_id.fax|default('', True)}}
                        {%endif%}</span>
                                                                                </td>
                                                                            </tr>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-81"
                                                                                        class=" oe_form_label_help oe_align_right"
                                                                                        data-original-title="" title="">
                                                                                    采购联系人
                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%"><span
                                                                                        class="oe_form_char_content">{{purchase_order.validator.name|default('', True)}}</span>
                                                                                </td>
                                                                            </tr>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-81"
                                                                                        class=" oe_form_label_help oe_align_right"
                                                                                        data-original-title="" title="">
                                                                                    采购电话
                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%"><span
                                                                                        class="oe_form_char_content">021-31260666</span>
                                                                                </td>
                                                                            </tr>                                                                                                                                                       </tbody>
                                                                        </table>
                                                                    </td>
                                                                    <td class="oe_form_group_cell oe_group_right"
                                                                        colspan="1" width="50%">
                                                                        <table border="0" cellpadding="0"
                                                                               cellspacing="0" class="oe_form_group ">
                                                                            <tbody>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-82"
                                                                                        class=" oe_form_label_help oe_align_right"
                                                                                        data-original-title="" title="">
                                                                                    下单日期
                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%"><span
                                                                                        class="oe_form_field oe_form_field_many2one oe_form_field_with_button oe_form_required">

            <span class="oe_form_char_content">{{purchase_order.create_date|strftime('%Y-%m-%d')}}</span>


    </span></td>
                                                                            </tr>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-83"
                                                                                        class="oe_form_label_help oe_align_right"
                                                                                        data-original-title="" title="">
                                                                                    期望到货日期
                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%">
                                                                                     <span class="oe_form_char_content" style="font-size: 12pt;font-weight: bold;">

                            {%if purchase_order.planned_delivery_date%}
                                {{ purchase_order.planned_delivery_date}}
                            {%endif%}
                        </span>
                                                                                </td>
                                                                            </tr>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-84"
                                                                                        class=" oe_form_label oe_align_right">
                                                                                    {% if purchase_order.is_self_pickup %}
                                                                                    需要自提 (地址)
                                                                                    {% else %}
                                                                                        {% if purchase_order.is_direct_delivery %}
                                                                                        {% else %}
                                                                                        收货地址/收货人
                                                                                        {% endif %}
                                                                                    {% endif %}
                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%"><span
                                                                                        class="oe_form_char_content">
{% if purchase_order.is_self_pickup %}
{{ purchase_order.supplier_address|default(' ', True)}}
{% else %}
        {% if purchase_order.is_direct_delivery %}
        {% else %}
            <!-- 当不是自提, 并且不是直送,才显示收货地址 -->
            {% if purchase_order.develiey_address %}
            {{ purchase_order.develiey_address|default(' ', True)}}
            {% else %}
            {{ purchase_order.shipping_method.name|default(' ', True)}}
            {% endif %}
        {% endif %}
{% endif %}

        </span></td>
                                                                            </tr>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-85"
                                                                                        class="oe_form_label_help oe_align_right"
                                                                                        data-original-title="" title="">
                                                                                    {% if purchase_order.is_direct_delivery %}
                                                                                    需要供应商直送 到
                                                                                    {% else %}

                                                                                    {% endif %}

                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%">
                                                                                    {% if purchase_order.is_direct_delivery %}
                                                                                    {{ purchase_order.develiey_address|default(' ', True)}}
                                                                                    {% else %}

                                                                                    {% endif %}
                                                                                </td>
                                                                            </tr>
                                                                            <tr class="oe_form_group_row">
                                                                                <td class="oe_form_group_cell oe_form_group_cell_label"
                                                                                    colspan="1" width="1%"><label
                                                                                        for="oe-field-input-85"
                                                                                        class="oe_form_label_help oe_align_right"
                                                                                        data-original-title="" title="">

                                                                                </label></td>
                                                                                <td class="oe_form_group_cell"
                                                                                    colspan="1" width="99%">
                                                                                </td>
                                                                            </tr>
                                                                            </tbody>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                                </tbody>
                                                            </table>

                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>

                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </td>
            </tr>
            </tbody>
        </table>


        <table class="oe_list_content" width="100%">
            <thead>
            <tr>
                <th width="60" style="text-align: left;">#</th>
                <th class="oe_list_header_text nowrap" style="text-align: left;">产品名称</th>
                <th class="oe_list_header_text nowrap" style="text-align: left;"><span class="nowrap" style="text-align: left;">产品型号</span></th>
                <th class="oe_list_header_text nowrap" style="text-align: left;"><span class="nowrap" style="text-align: left;">产品规格</span></th>
                <th class="oe_list_header_text nowrap" style="text-align: left;"><span class="nowrap" style="text-align: left;">规格备注</span></th>
                <th class="oe_list_header_text nowrap" style="text-align: left;"><span class="nowrap" style="text-align: left;">采购备注</span></th>
                <!--<th class="oe_list_header_text nowrap" style="text-align: right;">产品价格</th>-->
                <th class="oe_list_header_text nowrap" style="text-align: right;"><span class="nowrap" style="text-align: left;">数量</span></th>
            </tr>
            </thead>
            <tbody>
                {% for line in purchase_order.order_line %}
                <tr>
                    <td align="left" >
                        {% if loop.index < 10 %}
                            0{{loop.index}}
                        {% else %}
                            {{loop.index}}
                        {%endif%}
                    </td>
                    <td style="text-align: left;">
                        <div>
                            <span>
                                {{line.name}}
                            </span>
                        </div>
                    </td>
                    <td style="text-align: left;">
                        {{line.product_id.prod_model|default(' ', True)}}
                    </td>
                    <td style="text-align: left;">
                        {{line.product_id.prod_spec|default(' ', True)}}
                    </td>
                    <td style="text-align: left;">{{line.prod_spec|default(" ", True)}} </td>
                    <td style="text-align: left;">{{line.purchase_spec|default(" ", True)}} </td>
                    <td style="text-align: right;">{{line.product_qty|int()}}</td>
                    <!--<td style="text-align: right;">-->
                        <!--{{line.price_unit|round(2)}}-->
                    <!--</td>-->
                </tr>
                {% endfor %}
            </tbody>
            <!--<tfoot>-->
            	<!--<tr>-->
                <!--<td colspan="5"></td>-->
                <!--<td class="field_caption" align="right">-->
                	<!--合计: {{purchase_order.amount_total}}-->
                <!--</td>-->
                <!--</tr>-->
            <!--</tfoot>-->
        </table>
            备注：<br />
        <div class="oe_form_char_content" style="border-top: 1px solid #aaa; font-size: 12pt;font-weight: bold; line-height: 150%">
            {% if purchase_order.notes %}{{purchase_order.notes.replace('\n', '<br/>')|safe}}{% endif %}
        </div>
    </div>


</body>
</html>
